package com.android2024.no5_monkey;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity
    implements View.OnClickListener{

    int numbel = 0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        numbel = intent.getIntExtra("numbel",0);

        setContentView(R.layout.main);
        findViewById(R.id.entry).setOnClickListener(this);
        ((TextView)findViewById(R.id.numbel)).setText("桃子数:"+numbel);
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent();
        intent.setClass(this,GradenActivity.class);
        startActivity(intent);
        finish();
    }
}